import axios from 'axios'
export function exportExcel(data, name) {
  console.log(111)
  const blob = new Blob([data], {
    type: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
  })
  if (window.navigator.msSaveOrOpenBlob) {
    navigator.msSaveBlob(blob)
  } else {
    const elink = document.createElement('a')
    elink.download = `${name}.xls`
    elink.style.display = 'none'
    elink.href = URL.createObjectURL(blob)
    document.body.appendChild(elink)
    elink.click()
    document.body.removeChild(elink)
  }
}

 export function haveKeyObj(obj) {
    let flag = false
    for (const prop in obj) {
      if (obj[prop]) {
        flag = true
        break
      }
    }
    return flag
  }